/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.anhanguera.tcc.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Diego
 */
@Embeddable
public class ItemComprovanteEntregaPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "COD_ITEM_CONTRATO")
    private int codItemContrato;
    @Basic(optional = false)
    @NotNull
    @Column(name = "COD_COMPROVANTE_ENTREGA")
    private int codComprovanteEntrega;

    public ItemComprovanteEntregaPK() {
    }

    public ItemComprovanteEntregaPK(int codItemContrato, int codComprovanteEntrega) {
        this.codItemContrato = codItemContrato;
        this.codComprovanteEntrega = codComprovanteEntrega;
    }

    public int getCodItemContrato() {
        return codItemContrato;
    }

    public void setCodItemContrato(int codItemContrato) {
        this.codItemContrato = codItemContrato;
    }

    public int getCodComprovanteEntrega() {
        return codComprovanteEntrega;
    }

    public void setCodComprovanteEntrega(int codComprovanteEntrega) {
        this.codComprovanteEntrega = codComprovanteEntrega;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codItemContrato;
        hash += (int) codComprovanteEntrega;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ItemComprovanteEntregaPK)) {
            return false;
        }
        ItemComprovanteEntregaPK other = (ItemComprovanteEntregaPK) object;
        if (this.codItemContrato != other.codItemContrato) {
            return false;
        }
        if (this.codComprovanteEntrega != other.codComprovanteEntrega) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.anhanguera.tcc.model.ItemComprovanteEntregaPK[ codItemContrato=" + codItemContrato + ", codComprovanteEntrega=" + codComprovanteEntrega + " ]";
    }

}
